PHP Add Year to Date

40

add a year php -

$end = date('Y-m-d', strtotime('+5 years'));

PHP Add Year to Date -

//variable date
$date = "2022-02-01";
$newDate = date('Y-m-d', strtotime($date. ' + 3 years'));

//curent date
$newDate = date('Y-m-d', strtotime(' + 3 years'));

Comments

Submit
0 Comments